home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / plugin / nsPIPluginHost.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  178 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsPIPluginHost.idl
  3.  */
  4.  
  5. #ifndef __gen_nsPIPluginHost_h__
  6. #define __gen_nsPIPluginHost_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIPluginInstance_h__
  14. #include "nsIPluginInstance.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. #include "nsPluginNativeWindow.h"
  22.  
  23. /* starting interface:    nsPIPluginHost */
  24. #define NS_PIPLUGINHOST_IID_STR "8e3d71e6-2319-11d5-9cf8-0060b0fbd8ac"
  25.  
  26. #define NS_PIPLUGINHOST_IID \
  27.   {0x8e3d71e6, 0x2319, 0x11d5, \
  28.     { 0x9c, 0xf8, 0x00, 0x60, 0xb0, 0xfb, 0xd8, 0xac }}
  29.  
  30. class NS_NO_VTABLE nsPIPluginHost : public nsISupports {
  31.  public: 
  32.  
  33.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_PIPLUGINHOST_IID)
  34.  
  35.   /**
  36.   * To notify the plugin manager that the plugin created a script object 
  37.   */
  38.   /* void setIsScriptableInstance (in nsIPluginInstance aInstance, in boolean aScriptable); */
  39.   NS_IMETHOD SetIsScriptableInstance(nsIPluginInstance *aInstance, PRBool aScriptable) = 0;
  40.  
  41.   /**
  42.   * This method parses post buffer to find out case insensitive "Content-length" string
  43.   * and CR or LF some where after that, then it assumes there is http headers in
  44.   * the input buffer and continue to search for end of headers (CRLFCRLF or LFLF).
  45.   * It will *always malloc()* output buffer (caller is responsible to free it) 
  46.   * if input buffer starts with LF, which comes from 4.x spec 
  47.   * http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754
  48.   * "If no custom headers are required, simply add a blank
  49.   * line ('\n') to the beginning of the file or buffer.",
  50.   * it skips that '\n' and considers rest of the input buffer as data.
  51.   * If "Content-length" string and end of headers is found 
  52.   *   it substitutes single LF with CRLF in the headers, so the end of headers
  53.   *   always will be CRLFCRLF (single CR in headers, if any, remain untouched)
  54.   * else
  55.   *   it puts "Content-length: "+size_of_data+CRLFCRLF at the beginning of the output buffer
  56.   * and memcpy data to the output buffer 
  57.   *
  58.   * On failure outPostData and outPostDataLen will be set in 0.  
  59.   * @param aInPostData      - the post data
  60.   * @param aInPostDataLen   - the length aInPostData
  61.   * @param aOutPostData     - the buffer
  62.   * @param aOutPostDataLen  - the length of aOutPostData
  63.   **/
  64.   /* void parsePostBufferToFixHeaders (in string aInPostData, in unsigned long aInPostDataLen, out string aOutPostData, out unsigned long aOutPostDataLen); */
  65.   NS_IMETHOD ParsePostBufferToFixHeaders(const char *aInPostData, PRUint32 aInPostDataLen, char **aOutPostData, PRUint32 *aOutPostDataLen) = 0;
  66.  
  67.   /**
  68.   * To create tmp file with Content len header in, it will use by http POST
  69.   */
  70.   /* void createTmpFileToPost (in string aPostDataURL, out string aTmpFileName); */
  71.   NS_IMETHOD CreateTmpFileToPost(const char *aPostDataURL, char **aTmpFileName) = 0;
  72.  
  73.   /**
  74.   *  Creates a new plugin native window object
  75.   */
  76.   /* void newPluginNativeWindow (out nsPluginNativeWindowPtr aPluginNativeWindow); */
  77.   NS_IMETHOD NewPluginNativeWindow(nsPluginNativeWindow * *aPluginNativeWindow) = 0;
  78.  
  79.   /**
  80.   *  Deletes plugin native window object created by NewPluginNativeWindow
  81.   */
  82.   /* void deletePluginNativeWindow (in nsPluginNativeWindowPtr aPluginNativeWindow); */
  83.   NS_IMETHOD DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow) = 0;
  84.  
  85. };
  86.  
  87. /* Use this macro when declaring classes that implement this interface. */
  88. #define NS_DECL_NSPIPLUGINHOST \
  89.   NS_IMETHOD SetIsScriptableInstance(nsIPluginInstance *aInstance, PRBool aScriptable); \
  90.   NS_IMETHOD ParsePostBufferToFixHeaders(const char *aInPostData, PRUint32 aInPostDataLen, char **aOutPostData, PRUint32 *aOutPostDataLen); \
  91.   NS_IMETHOD CreateTmpFileToPost(const char *aPostDataURL, char **aTmpFileName); \
  92.   NS_IMETHOD NewPluginNativeWindow(nsPluginNativeWindow * *aPluginNativeWindow); \
  93.   NS_IMETHOD DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow); 
  94.  
  95. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  96. #define NS_FORWARD_NSPIPLUGINHOST(_to) \
  97.   NS_IMETHOD SetIsScriptableInstance(nsIPluginInstance *aInstance, PRBool aScriptable) { return _to SetIsScriptableInstance(aInstance, aScriptable); } \
  98.   NS_IMETHOD ParsePostBufferToFixHeaders(const char *aInPostData, PRUint32 aInPostDataLen, char **aOutPostData, PRUint32 *aOutPostDataLen) { return _to ParsePostBufferToFixHeaders(aInPostData, aInPostDataLen, aOutPostData, aOutPostDataLen); } \
  99.   NS_IMETHOD CreateTmpFileToPost(const char *aPostDataURL, char **aTmpFileName) { return _to CreateTmpFileToPost(aPostDataURL, aTmpFileName); } \
  100.   NS_IMETHOD NewPluginNativeWindow(nsPluginNativeWindow * *aPluginNativeWindow) { return _to NewPluginNativeWindow(aPluginNativeWindow); } \
  101.   NS_IMETHOD DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow) { return _to DeletePluginNativeWindow(aPluginNativeWindow); } 
  102.  
  103. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  104. #define NS_FORWARD_SAFE_NSPIPLUGINHOST(_to) \
  105.   NS_IMETHOD SetIsScriptableInstance(nsIPluginInstance *aInstance, PRBool aScriptable) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIsScriptableInstance(aInstance, aScriptable); } \
  106.   NS_IMETHOD ParsePostBufferToFixHeaders(const char *aInPostData, PRUint32 aInPostDataLen, char **aOutPostData, PRUint32 *aOutPostDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParsePostBufferToFixHeaders(aInPostData, aInPostDataLen, aOutPostData, aOutPostDataLen); } \
  107.   NS_IMETHOD CreateTmpFileToPost(const char *aPostDataURL, char **aTmpFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateTmpFileToPost(aPostDataURL, aTmpFileName); } \
  108.   NS_IMETHOD NewPluginNativeWindow(nsPluginNativeWindow * *aPluginNativeWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewPluginNativeWindow(aPluginNativeWindow); } \
  109.   NS_IMETHOD DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeletePluginNativeWindow(aPluginNativeWindow); } 
  110.  
  111. #if 0
  112. /* Use the code below as a template for the implementation class for this interface. */
  113.  
  114. /* Header file */
  115. class _MYCLASS_ : public nsPIPluginHost
  116. {
  117. public:
  118.   NS_DECL_ISUPPORTS
  119.   NS_DECL_NSPIPLUGINHOST
  120.  
  121.   _MYCLASS_();
  122.  
  123. private:
  124.   ~_MYCLASS_();
  125.  
  126. protected:
  127.   /* additional members */
  128. };
  129.  
  130. /* Implementation file */
  131. NS_IMPL_ISUPPORTS1(_MYCLASS_, nsPIPluginHost)
  132.  
  133. _MYCLASS_::_MYCLASS_()
  134. {
  135.   /* member initializers and constructor code */
  136. }
  137.  
  138. _MYCLASS_::~_MYCLASS_()
  139. {
  140.   /* destructor code */
  141. }
  142.  
  143. /* void setIsScriptableInstance (in nsIPluginInstance aInstance, in boolean aScriptable); */
  144. NS_IMETHODIMP _MYCLASS_::SetIsScriptableInstance(nsIPluginInstance *aInstance, PRBool aScriptable)
  145. {
  146.     return NS_ERROR_NOT_IMPLEMENTED;
  147. }
  148.  
  149. /* void parsePostBufferToFixHeaders (in string aInPostData, in unsigned long aInPostDataLen, out string aOutPostData, out unsigned long aOutPostDataLen); */
  150. NS_IMETHODIMP _MYCLASS_::ParsePostBufferToFixHeaders(const char *aInPostData, PRUint32 aInPostDataLen, char **aOutPostData, PRUint32 *aOutPostDataLen)
  151. {
  152.     return NS_ERROR_NOT_IMPLEMENTED;
  153. }
  154.  
  155. /* void createTmpFileToPost (in string aPostDataURL, out string aTmpFileName); */
  156. NS_IMETHODIMP _MYCLASS_::CreateTmpFileToPost(const char *aPostDataURL, char **aTmpFileName)
  157. {
  158.     return NS_ERROR_NOT_IMPLEMENTED;
  159. }
  160.  
  161. /* void newPluginNativeWindow (out nsPluginNativeWindowPtr aPluginNativeWindow); */
  162. NS_IMETHODIMP _MYCLASS_::NewPluginNativeWindow(nsPluginNativeWindow * *aPluginNativeWindow)
  163. {
  164.     return NS_ERROR_NOT_IMPLEMENTED;
  165. }
  166.  
  167. /* void deletePluginNativeWindow (in nsPluginNativeWindowPtr aPluginNativeWindow); */
  168. NS_IMETHODIMP _MYCLASS_::DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow)
  169. {
  170.     return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172.  
  173. /* End of implementation class template. */
  174. #endif
  175.  
  176.  
  177. #endif /* __gen_nsPIPluginHost_h__ */
  178.